#ifndef PLAYER_H
#define PLAYER_H

#include <QGraphicsPixmapItem>
#include <QMap>
#include <QPointF>

class Player : public QGraphicsPixmapItem
{
public:
    Player(QGraphicsItem *parent = nullptr);

    // 根据按键状态移动玩家
    void move(const QMap<int, bool> &keys);

    // 让玩家朝向鼠标位置
    void setRotationToMouse(const QPointF &mousePos);

private:
    qreal m_speed; // 移动速度
};

#endif // PLAYER_H
